# Contributor: Ed Robinson <edward-robinson@cookpad.com>
# Maintainer: Ed Robinson <edward-robinson@cookpad.com>
pkgname=sbt
pkgver=1.3.13
pkgrel=1
pkgdesc="The interactive build tool, sbt is a build tool for Scala, Java, and more."
url="https://www.scala-sbt.org/"
arch="noarch !mips !mips64" # java
license="BSD-3-Clause"
options="!check"
depends="openjdk8-jre-base bash"
source="https://github.com/$pkgname/$pkgname/releases/download/v$pkgver/$pkgname-$pkgver.tgz"
builddir="$srcdir/$pkgname"
_basedir="/usr/share/java/$pkgname"

package() {
	local destdir="$pkgdir/$_basedir"
	local confdir="$pkgdir/etc/$pkgname"
	cd "$builddir"

	install -dm755 "$destdir"/bin || return 1
	install -m755 -t "$destdir"/bin bin/* || return 1

	install -dm755 "$confdir" || return 1
	install -m644 -t "$confdir" conf/* || return 1

	mkdir -p "$pkgdir"/usr/bin
	ln -s "$_basedir/bin/sbt" "$pkgdir/usr/bin/sbt" || return 1

	# Remove windows specific files
	rm $destdir/bin/sbt.bat
	rm $confdir/sbtconfig.txt
}

sha512sums="578f5d79e7242a18a3058d3930ee3fa9ca5bc57c242f3637e372284659187275217be0682437e2d4f75216e8d5d0c1670dfd99009eef23221163727051721bd9  sbt-1.3.13.tgz"
